package top.datacluster.basic.offer;

public class PrintNBigNumber {

    public static void main(String[] args) {
        print(4);
    }

    public static void print(int n){
        char[] result = new char[n+1];
        for (int i = 0; i < result.length; i++){
            result[i] = '0';
        }
        while (result[0] != '1'){
            for (int i = result.length - 1; ;){
                if (result[i] == '9'){
                    result[i] = '0';
                    i--;
                }else{
                    result[i] = (char)((int)result[i] + 1);
                    print(result);
                    break;
                }
            }
        }

    }

    public static void print(char[] c){
        for (int i = 1; i < c.length; i++){
            System.out.print(c[i]);
        }
        System.out.println();
    }
}
